export const crudOptions = vm => {
  return {
    indexRow: {
      title: '序号',
      align: 'center'
    },
    options: {
      height: '100%'
    },
    // 还要添加一个字段用于判断仓储量
    columns: [
      {
        title: '仓库名称',
        key: 'name',
        align: 'center',
        form: {
          disabled: false,
          rules: [
            { required: true, trigger: 'blur', message: '请输入仓库名字' },
            { max: 10, trigger: 'blur', message: '仓库名称不得大于10个字符串' }
          ]
        },
        search: {
          disabled: false
        }
      },
      {
        title: '仓储数量',
        key: 'storage',
        align: 'center',
        form: {
          disabled: false,
          rules: [
            { required: true, trigger: 'blur', message: '请输入仓储数量' },
            { pattern: /^\+?[1-9][0-9]*$/, trigger: 'blur', message: '请输入数字' }
          ]
        }
      },
      {
        title: '当前存储量',
        key: 'nowStorage',
        align: 'center',
        form: {
          disabled: true
        },
        component: {
          disabled: true
        }
      }
    ],
    rowHandle: {
      view: false,
      align: 'center',
      custom: [
        {
          thin: false,
          text: '查看',
          icon: 'el-icon-view',
          size: 'small',
          show: true,
          disabled: false,
          order: 1,
          emit: 'view'
        }
      ]
    }
  }
}
